home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Agent Central Host Computer
/
Agent - Central Host Computer.iso
/
_SETUP.1
/
vmonthlyriders.sql
< prev
next >
Wrap
Text File
|
2000-05-12
|
780b
|
22 lines
CREATE OR REPLACE VIEW VMONTHLYRIDERS ( REPORT_DATE,
COUNT_OF_AMOUNTS, TOT_AMT, AUTODUMP, LOW,
HIGH, DUMPUPR, AUTOHILODUMP, NUM_BUSES
) AS SELECT
/*FAREENTR.FAREBOX_GLID,*/ TRUNC(FAREENTR.CONV_DATE) report_date,
COUNT(FAREENTR.AMOUNT) count_of_amounts,
SUM(FAREENTR.AMOUNT) tot_amt, SUM(FAREENTR.AUTO_DUMP) autodump, SUM(FAREENTR.LOW_FARE) low,
SUM(FAREENTR.HIGH_FARE) high , SUM(FAREENTR.DUMP_UPR) dumpupr,
SUM(FAREENTR.AUTO_DUMP + FAREENTR.LOW_FARE + FAREENTR.HIGH_FARE + FAREENTR.DUMP_UPR) autohilodump,
COUNT(DISTINCT BUS.BUS_ID) num_buses
FROM
FAREENTR FAREENTR,
BUS BUS,
GARAGE GARAGE,
FAREBOX FAREBOX
WHERE
( FAREENTR.FAREBOX_GLID=FAREBOX.GLID ) AND
( FAREBOX.LOCATION=BUS.GLID )
GROUP BY
TRUNC(FAREENTR.CONV_DATE);